/**
 * Author:runlin。tang.
 * Creation Time: 2016/6/29
 * Description:
 *              充电宝wifi网络列表函数
 */

define(['jquery','../m/ulList'], function ($,ulList) {
    chose_wifi();
    function chose_wifi () {
        $('#chose-wifi').on('click', function(event) {
            ulList();
            var obj = $(this);
            setTimeout(function(){
                obj.toggleClass('darkgreay_b');
                if (obj.hasClass('darkgreay_b')) {
                    obj.siblings('.name-list').show();
                }
                else{
                    obj.siblings('.name-list').hide();
                }
            },300);
        });
        $('.ly-pppoe').on('click','.select li', function(event) {
            $('.select input').val($(this).text());
            var mac = $(this).attr('mac');
            $('.select input').attr('mac',mac);
            $(this).addClass('chosed').siblings('li').removeClass('chosed');
            $(this).parents('.name-list').hide();
            $(this).parent().prev().removeClass('darkgreay_b');
        });
    }
    return chose_wifi;
});